// Phong 光照模型下 模型shader
#version 460 core
layout (location = 0) in vec3 aPos; // 顶点坐标
layout (location = 1) in vec3 aNormal; // 顶点法向

out vec3 FragPos;
out vec3 Normal;

uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;

void main()
{
    // Phong 光照模型 在世界坐标下进行计算 方便理解
    FragPos = vec3(model * vec4(aPos, 1.0)); // 世界坐标下顶点坐标
    Normal = mat3(transpose(inverse(model))) * aNormal;  // 世界坐标下顶点法向量
    
    gl_Position = projection * view * vec4(FragPos, 1.0);
}